﻿#region Using directives

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;

using GPSTrackingDBV2.Entities;
using GPSTrackingDBV2.Data;

#endregion

namespace GPSTrackingDBV2.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="CompaniesProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract partial class CompaniesProviderBaseCore : EntityProviderBase<GPSTrackingDBV2.Entities.Companies, GPSTrackingDBV2.Entities.CompaniesKey>
	{		
		#region Get from Many To Many Relationship Functions
		#region GetByBusRouteIdFromBusRouteByCompanies
		
		/// <summary>
		///		Gets Companies objects from the datasource by BusRouteID in the
		///		BusRouteByCompanies table. Table Companies is related to table BusRoutes
		///		through the (M:N) relationship defined in the BusRouteByCompanies table.
		/// </summary>
		/// <param name="_busRouteId"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByBusRouteIdFromBusRouteByCompanies(System.Int32 _busRouteId)
		{
			int count = -1;
			return GetByBusRouteIdFromBusRouteByCompanies(null,_busRouteId, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by BusRouteID in the
		///		BusRouteByCompanies table. Table Companies is related to table BusRoutes
		///		through the (M:N) relationship defined in the BusRouteByCompanies table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_busRouteId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetByBusRouteIdFromBusRouteByCompanies(System.Int32 _busRouteId, int start, int pageLength)
		{
			int count = -1;
			return GetByBusRouteIdFromBusRouteByCompanies(null, _busRouteId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by BusRouteID in the
		///		BusRouteByCompanies table. Table Companies is related to table BusRoutes
		///		through the (M:N) relationship defined in the BusRouteByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_busRouteId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByBusRouteIdFromBusRouteByCompanies(TransactionManager transactionManager, System.Int32 _busRouteId)
		{
			int count = -1;
			return GetByBusRouteIdFromBusRouteByCompanies(transactionManager, _busRouteId, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by BusRouteID in the
		///		BusRouteByCompanies table. Table Companies is related to table BusRoutes
		///		through the (M:N) relationship defined in the BusRouteByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_busRouteId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByBusRouteIdFromBusRouteByCompanies(TransactionManager transactionManager, System.Int32 _busRouteId,int start, int pageLength)
		{
			int count = -1;
			return GetByBusRouteIdFromBusRouteByCompanies(transactionManager, _busRouteId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by BusRouteID in the
		///		BusRouteByCompanies table. Table Companies is related to table BusRoutes
		///		through the (M:N) relationship defined in the BusRouteByCompanies table.
		/// </summary>
		/// <param name="_busRouteId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByBusRouteIdFromBusRouteByCompanies(System.Int32 _busRouteId,int start, int pageLength, out int count)
		{
			
			return GetByBusRouteIdFromBusRouteByCompanies(null, _busRouteId, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by BusRouteID in the
		///		BusRouteByCompanies table. Table Companies is related to table BusRoutes
		///		through the (M:N) relationship defined in the BusRouteByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_busRouteId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetByBusRouteIdFromBusRouteByCompanies(TransactionManager transactionManager,System.Int32 _busRouteId, int start, int pageLength, out int count);
		
		#endregion GetByBusRouteIdFromBusRouteByCompanies
		
		#region GetByClientGroupIdFromClientsGroupsByCompanies
		
		/// <summary>
		///		Gets Companies objects from the datasource by ClientGroupID in the
		///		ClientsGroupsByCompanies table. Table Companies is related to table ClientsGroups
		///		through the (M:N) relationship defined in the ClientsGroupsByCompanies table.
		/// </summary>
		/// <param name="_clientGroupId"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByClientGroupIdFromClientsGroupsByCompanies(System.Int32 _clientGroupId)
		{
			int count = -1;
			return GetByClientGroupIdFromClientsGroupsByCompanies(null,_clientGroupId, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by ClientGroupID in the
		///		ClientsGroupsByCompanies table. Table Companies is related to table ClientsGroups
		///		through the (M:N) relationship defined in the ClientsGroupsByCompanies table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_clientGroupId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetByClientGroupIdFromClientsGroupsByCompanies(System.Int32 _clientGroupId, int start, int pageLength)
		{
			int count = -1;
			return GetByClientGroupIdFromClientsGroupsByCompanies(null, _clientGroupId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by ClientGroupID in the
		///		ClientsGroupsByCompanies table. Table Companies is related to table ClientsGroups
		///		through the (M:N) relationship defined in the ClientsGroupsByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_clientGroupId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByClientGroupIdFromClientsGroupsByCompanies(TransactionManager transactionManager, System.Int32 _clientGroupId)
		{
			int count = -1;
			return GetByClientGroupIdFromClientsGroupsByCompanies(transactionManager, _clientGroupId, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by ClientGroupID in the
		///		ClientsGroupsByCompanies table. Table Companies is related to table ClientsGroups
		///		through the (M:N) relationship defined in the ClientsGroupsByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_clientGroupId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByClientGroupIdFromClientsGroupsByCompanies(TransactionManager transactionManager, System.Int32 _clientGroupId,int start, int pageLength)
		{
			int count = -1;
			return GetByClientGroupIdFromClientsGroupsByCompanies(transactionManager, _clientGroupId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by ClientGroupID in the
		///		ClientsGroupsByCompanies table. Table Companies is related to table ClientsGroups
		///		through the (M:N) relationship defined in the ClientsGroupsByCompanies table.
		/// </summary>
		/// <param name="_clientGroupId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByClientGroupIdFromClientsGroupsByCompanies(System.Int32 _clientGroupId,int start, int pageLength, out int count)
		{
			
			return GetByClientGroupIdFromClientsGroupsByCompanies(null, _clientGroupId, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by ClientGroupID in the
		///		ClientsGroupsByCompanies table. Table Companies is related to table ClientsGroups
		///		through the (M:N) relationship defined in the ClientsGroupsByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_clientGroupId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetByClientGroupIdFromClientsGroupsByCompanies(TransactionManager transactionManager,System.Int32 _clientGroupId, int start, int pageLength, out int count);
		
		#endregion GetByClientGroupIdFromClientsGroupsByCompanies
		
		#region GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles
		
		/// <summary>
		///		Gets Companies objects from the datasource by AdministratorRoleID in the
		///		CompaniesByAdministratorsRoles table. Table Companies is related to table AdministratorsRoles
		///		through the (M:N) relationship defined in the CompaniesByAdministratorsRoles table.
		/// </summary>
		/// <param name="_administratorRoleId"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles(System.Int32 _administratorRoleId)
		{
			int count = -1;
			return GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles(null,_administratorRoleId, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by AdministratorRoleID in the
		///		CompaniesByAdministratorsRoles table. Table Companies is related to table AdministratorsRoles
		///		through the (M:N) relationship defined in the CompaniesByAdministratorsRoles table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_administratorRoleId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles(System.Int32 _administratorRoleId, int start, int pageLength)
		{
			int count = -1;
			return GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles(null, _administratorRoleId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by AdministratorRoleID in the
		///		CompaniesByAdministratorsRoles table. Table Companies is related to table AdministratorsRoles
		///		through the (M:N) relationship defined in the CompaniesByAdministratorsRoles table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_administratorRoleId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles(TransactionManager transactionManager, System.Int32 _administratorRoleId)
		{
			int count = -1;
			return GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles(transactionManager, _administratorRoleId, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by AdministratorRoleID in the
		///		CompaniesByAdministratorsRoles table. Table Companies is related to table AdministratorsRoles
		///		through the (M:N) relationship defined in the CompaniesByAdministratorsRoles table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_administratorRoleId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles(TransactionManager transactionManager, System.Int32 _administratorRoleId,int start, int pageLength)
		{
			int count = -1;
			return GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles(transactionManager, _administratorRoleId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by AdministratorRoleID in the
		///		CompaniesByAdministratorsRoles table. Table Companies is related to table AdministratorsRoles
		///		through the (M:N) relationship defined in the CompaniesByAdministratorsRoles table.
		/// </summary>
		/// <param name="_administratorRoleId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles(System.Int32 _administratorRoleId,int start, int pageLength, out int count)
		{
			
			return GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles(null, _administratorRoleId, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by AdministratorRoleID in the
		///		CompaniesByAdministratorsRoles table. Table Companies is related to table AdministratorsRoles
		///		through the (M:N) relationship defined in the CompaniesByAdministratorsRoles table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_administratorRoleId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles(TransactionManager transactionManager,System.Int32 _administratorRoleId, int start, int pageLength, out int count);
		
		#endregion GetByAdministratorRoleIdFromCompaniesByAdministratorsRoles
		
		#region GetByDepartmentIdFromCompaniesByDepartments
		
		/// <summary>
		///		Gets Companies objects from the datasource by DepartmentID in the
		///		CompaniesByDepartments table. Table Companies is related to table Departments
		///		through the (M:N) relationship defined in the CompaniesByDepartments table.
		/// </summary>
		/// <param name="_departmentId"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByDepartmentIdFromCompaniesByDepartments(System.Int32 _departmentId)
		{
			int count = -1;
			return GetByDepartmentIdFromCompaniesByDepartments(null,_departmentId, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by DepartmentID in the
		///		CompaniesByDepartments table. Table Companies is related to table Departments
		///		through the (M:N) relationship defined in the CompaniesByDepartments table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_departmentId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetByDepartmentIdFromCompaniesByDepartments(System.Int32 _departmentId, int start, int pageLength)
		{
			int count = -1;
			return GetByDepartmentIdFromCompaniesByDepartments(null, _departmentId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by DepartmentID in the
		///		CompaniesByDepartments table. Table Companies is related to table Departments
		///		through the (M:N) relationship defined in the CompaniesByDepartments table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_departmentId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByDepartmentIdFromCompaniesByDepartments(TransactionManager transactionManager, System.Int32 _departmentId)
		{
			int count = -1;
			return GetByDepartmentIdFromCompaniesByDepartments(transactionManager, _departmentId, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by DepartmentID in the
		///		CompaniesByDepartments table. Table Companies is related to table Departments
		///		through the (M:N) relationship defined in the CompaniesByDepartments table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_departmentId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByDepartmentIdFromCompaniesByDepartments(TransactionManager transactionManager, System.Int32 _departmentId,int start, int pageLength)
		{
			int count = -1;
			return GetByDepartmentIdFromCompaniesByDepartments(transactionManager, _departmentId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by DepartmentID in the
		///		CompaniesByDepartments table. Table Companies is related to table Departments
		///		through the (M:N) relationship defined in the CompaniesByDepartments table.
		/// </summary>
		/// <param name="_departmentId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByDepartmentIdFromCompaniesByDepartments(System.Int32 _departmentId,int start, int pageLength, out int count)
		{
			
			return GetByDepartmentIdFromCompaniesByDepartments(null, _departmentId, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by DepartmentID in the
		///		CompaniesByDepartments table. Table Companies is related to table Departments
		///		through the (M:N) relationship defined in the CompaniesByDepartments table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_departmentId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetByDepartmentIdFromCompaniesByDepartments(TransactionManager transactionManager,System.Int32 _departmentId, int start, int pageLength, out int count);
		
		#endregion GetByDepartmentIdFromCompaniesByDepartments
		
		#region GetByGeoFenceIdFromCompaniesByGeoFences
		
		/// <summary>
		///		Gets Companies objects from the datasource by GeoFenceID in the
		///		CompaniesByGeoFences table. Table Companies is related to table GeoFences
		///		through the (M:N) relationship defined in the CompaniesByGeoFences table.
		/// </summary>
		/// <param name="_geoFenceId"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByGeoFenceIdFromCompaniesByGeoFences(System.Int32 _geoFenceId)
		{
			int count = -1;
			return GetByGeoFenceIdFromCompaniesByGeoFences(null,_geoFenceId, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by GeoFenceID in the
		///		CompaniesByGeoFences table. Table Companies is related to table GeoFences
		///		through the (M:N) relationship defined in the CompaniesByGeoFences table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_geoFenceId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetByGeoFenceIdFromCompaniesByGeoFences(System.Int32 _geoFenceId, int start, int pageLength)
		{
			int count = -1;
			return GetByGeoFenceIdFromCompaniesByGeoFences(null, _geoFenceId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by GeoFenceID in the
		///		CompaniesByGeoFences table. Table Companies is related to table GeoFences
		///		through the (M:N) relationship defined in the CompaniesByGeoFences table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_geoFenceId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByGeoFenceIdFromCompaniesByGeoFences(TransactionManager transactionManager, System.Int32 _geoFenceId)
		{
			int count = -1;
			return GetByGeoFenceIdFromCompaniesByGeoFences(transactionManager, _geoFenceId, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by GeoFenceID in the
		///		CompaniesByGeoFences table. Table Companies is related to table GeoFences
		///		through the (M:N) relationship defined in the CompaniesByGeoFences table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_geoFenceId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByGeoFenceIdFromCompaniesByGeoFences(TransactionManager transactionManager, System.Int32 _geoFenceId,int start, int pageLength)
		{
			int count = -1;
			return GetByGeoFenceIdFromCompaniesByGeoFences(transactionManager, _geoFenceId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by GeoFenceID in the
		///		CompaniesByGeoFences table. Table Companies is related to table GeoFences
		///		through the (M:N) relationship defined in the CompaniesByGeoFences table.
		/// </summary>
		/// <param name="_geoFenceId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByGeoFenceIdFromCompaniesByGeoFences(System.Int32 _geoFenceId,int start, int pageLength, out int count)
		{
			
			return GetByGeoFenceIdFromCompaniesByGeoFences(null, _geoFenceId, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by GeoFenceID in the
		///		CompaniesByGeoFences table. Table Companies is related to table GeoFences
		///		through the (M:N) relationship defined in the CompaniesByGeoFences table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_geoFenceId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetByGeoFenceIdFromCompaniesByGeoFences(TransactionManager transactionManager,System.Int32 _geoFenceId, int start, int pageLength, out int count);
		
		#endregion GetByGeoFenceIdFromCompaniesByGeoFences
		
		#region GetByGpsGroupIdFromCompaniesByGpsGroups
		
		/// <summary>
		///		Gets Companies objects from the datasource by GPSGroupID in the
		///		CompaniesByGPSGroups table. Table Companies is related to table GPSGroups
		///		through the (M:N) relationship defined in the CompaniesByGPSGroups table.
		/// </summary>
		/// <param name="_gpsGroupId"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByGpsGroupIdFromCompaniesByGpsGroups(System.Int32 _gpsGroupId)
		{
			int count = -1;
			return GetByGpsGroupIdFromCompaniesByGpsGroups(null,_gpsGroupId, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by GPSGroupID in the
		///		CompaniesByGPSGroups table. Table Companies is related to table GPSGroups
		///		through the (M:N) relationship defined in the CompaniesByGPSGroups table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_gpsGroupId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetByGpsGroupIdFromCompaniesByGpsGroups(System.Int32 _gpsGroupId, int start, int pageLength)
		{
			int count = -1;
			return GetByGpsGroupIdFromCompaniesByGpsGroups(null, _gpsGroupId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by GPSGroupID in the
		///		CompaniesByGPSGroups table. Table Companies is related to table GPSGroups
		///		through the (M:N) relationship defined in the CompaniesByGPSGroups table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_gpsGroupId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByGpsGroupIdFromCompaniesByGpsGroups(TransactionManager transactionManager, System.Int32 _gpsGroupId)
		{
			int count = -1;
			return GetByGpsGroupIdFromCompaniesByGpsGroups(transactionManager, _gpsGroupId, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by GPSGroupID in the
		///		CompaniesByGPSGroups table. Table Companies is related to table GPSGroups
		///		through the (M:N) relationship defined in the CompaniesByGPSGroups table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_gpsGroupId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByGpsGroupIdFromCompaniesByGpsGroups(TransactionManager transactionManager, System.Int32 _gpsGroupId,int start, int pageLength)
		{
			int count = -1;
			return GetByGpsGroupIdFromCompaniesByGpsGroups(transactionManager, _gpsGroupId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by GPSGroupID in the
		///		CompaniesByGPSGroups table. Table Companies is related to table GPSGroups
		///		through the (M:N) relationship defined in the CompaniesByGPSGroups table.
		/// </summary>
		/// <param name="_gpsGroupId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByGpsGroupIdFromCompaniesByGpsGroups(System.Int32 _gpsGroupId,int start, int pageLength, out int count)
		{
			
			return GetByGpsGroupIdFromCompaniesByGpsGroups(null, _gpsGroupId, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by GPSGroupID in the
		///		CompaniesByGPSGroups table. Table Companies is related to table GPSGroups
		///		through the (M:N) relationship defined in the CompaniesByGPSGroups table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_gpsGroupId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetByGpsGroupIdFromCompaniesByGpsGroups(TransactionManager transactionManager,System.Int32 _gpsGroupId, int start, int pageLength, out int count);
		
		#endregion GetByGpsGroupIdFromCompaniesByGpsGroups
		
		#region GetByMasterUsernameFromCompaniesByMasters
		
		/// <summary>
		///		Gets Companies objects from the datasource by MasterUsername in the
		///		CompaniesByMasters table. Table Companies is related to table Masters
		///		through the (M:N) relationship defined in the CompaniesByMasters table.
		/// </summary>
		/// <param name="_masterUsername"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByMasterUsernameFromCompaniesByMasters(System.String _masterUsername)
		{
			int count = -1;
			return GetByMasterUsernameFromCompaniesByMasters(null,_masterUsername, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by MasterUsername in the
		///		CompaniesByMasters table. Table Companies is related to table Masters
		///		through the (M:N) relationship defined in the CompaniesByMasters table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_masterUsername"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetByMasterUsernameFromCompaniesByMasters(System.String _masterUsername, int start, int pageLength)
		{
			int count = -1;
			return GetByMasterUsernameFromCompaniesByMasters(null, _masterUsername, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by MasterUsername in the
		///		CompaniesByMasters table. Table Companies is related to table Masters
		///		through the (M:N) relationship defined in the CompaniesByMasters table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_masterUsername"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByMasterUsernameFromCompaniesByMasters(TransactionManager transactionManager, System.String _masterUsername)
		{
			int count = -1;
			return GetByMasterUsernameFromCompaniesByMasters(transactionManager, _masterUsername, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by MasterUsername in the
		///		CompaniesByMasters table. Table Companies is related to table Masters
		///		through the (M:N) relationship defined in the CompaniesByMasters table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_masterUsername"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByMasterUsernameFromCompaniesByMasters(TransactionManager transactionManager, System.String _masterUsername,int start, int pageLength)
		{
			int count = -1;
			return GetByMasterUsernameFromCompaniesByMasters(transactionManager, _masterUsername, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by MasterUsername in the
		///		CompaniesByMasters table. Table Companies is related to table Masters
		///		through the (M:N) relationship defined in the CompaniesByMasters table.
		/// </summary>
		/// <param name="_masterUsername"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByMasterUsernameFromCompaniesByMasters(System.String _masterUsername,int start, int pageLength, out int count)
		{
			
			return GetByMasterUsernameFromCompaniesByMasters(null, _masterUsername, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by MasterUsername in the
		///		CompaniesByMasters table. Table Companies is related to table Masters
		///		through the (M:N) relationship defined in the CompaniesByMasters table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_masterUsername"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetByMasterUsernameFromCompaniesByMasters(TransactionManager transactionManager,System.String _masterUsername, int start, int pageLength, out int count);
		
		#endregion GetByMasterUsernameFromCompaniesByMasters
		
		#region GetByMenuIdFromCompaniesByMenu
		
		/// <summary>
		///		Gets Companies objects from the datasource by MenuID in the
		///		CompaniesByMenu table. Table Companies is related to table Menu
		///		through the (M:N) relationship defined in the CompaniesByMenu table.
		/// </summary>
		/// <param name="_menuId"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByMenuIdFromCompaniesByMenu(System.Int32 _menuId)
		{
			int count = -1;
			return GetByMenuIdFromCompaniesByMenu(null,_menuId, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by MenuID in the
		///		CompaniesByMenu table. Table Companies is related to table Menu
		///		through the (M:N) relationship defined in the CompaniesByMenu table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_menuId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetByMenuIdFromCompaniesByMenu(System.Int32 _menuId, int start, int pageLength)
		{
			int count = -1;
			return GetByMenuIdFromCompaniesByMenu(null, _menuId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by MenuID in the
		///		CompaniesByMenu table. Table Companies is related to table Menu
		///		through the (M:N) relationship defined in the CompaniesByMenu table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_menuId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByMenuIdFromCompaniesByMenu(TransactionManager transactionManager, System.Int32 _menuId)
		{
			int count = -1;
			return GetByMenuIdFromCompaniesByMenu(transactionManager, _menuId, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by MenuID in the
		///		CompaniesByMenu table. Table Companies is related to table Menu
		///		through the (M:N) relationship defined in the CompaniesByMenu table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_menuId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByMenuIdFromCompaniesByMenu(TransactionManager transactionManager, System.Int32 _menuId,int start, int pageLength)
		{
			int count = -1;
			return GetByMenuIdFromCompaniesByMenu(transactionManager, _menuId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by MenuID in the
		///		CompaniesByMenu table. Table Companies is related to table Menu
		///		through the (M:N) relationship defined in the CompaniesByMenu table.
		/// </summary>
		/// <param name="_menuId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByMenuIdFromCompaniesByMenu(System.Int32 _menuId,int start, int pageLength, out int count)
		{
			
			return GetByMenuIdFromCompaniesByMenu(null, _menuId, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by MenuID in the
		///		CompaniesByMenu table. Table Companies is related to table Menu
		///		through the (M:N) relationship defined in the CompaniesByMenu table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_menuId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetByMenuIdFromCompaniesByMenu(TransactionManager transactionManager,System.Int32 _menuId, int start, int pageLength, out int count);
		
		#endregion GetByMenuIdFromCompaniesByMenu
		
		#region GetBySettingIdFromCompaniesBySetting
		
		/// <summary>
		///		Gets Companies objects from the datasource by SettingID in the
		///		CompaniesBySetting table. Table Companies is related to table Setting
		///		through the (M:N) relationship defined in the CompaniesBySetting table.
		/// </summary>
		/// <param name="_settingId"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetBySettingIdFromCompaniesBySetting(System.Int32 _settingId)
		{
			int count = -1;
			return GetBySettingIdFromCompaniesBySetting(null,_settingId, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by SettingID in the
		///		CompaniesBySetting table. Table Companies is related to table Setting
		///		through the (M:N) relationship defined in the CompaniesBySetting table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_settingId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetBySettingIdFromCompaniesBySetting(System.Int32 _settingId, int start, int pageLength)
		{
			int count = -1;
			return GetBySettingIdFromCompaniesBySetting(null, _settingId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by SettingID in the
		///		CompaniesBySetting table. Table Companies is related to table Setting
		///		through the (M:N) relationship defined in the CompaniesBySetting table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_settingId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetBySettingIdFromCompaniesBySetting(TransactionManager transactionManager, System.Int32 _settingId)
		{
			int count = -1;
			return GetBySettingIdFromCompaniesBySetting(transactionManager, _settingId, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by SettingID in the
		///		CompaniesBySetting table. Table Companies is related to table Setting
		///		through the (M:N) relationship defined in the CompaniesBySetting table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_settingId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetBySettingIdFromCompaniesBySetting(TransactionManager transactionManager, System.Int32 _settingId,int start, int pageLength)
		{
			int count = -1;
			return GetBySettingIdFromCompaniesBySetting(transactionManager, _settingId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by SettingID in the
		///		CompaniesBySetting table. Table Companies is related to table Setting
		///		through the (M:N) relationship defined in the CompaniesBySetting table.
		/// </summary>
		/// <param name="_settingId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetBySettingIdFromCompaniesBySetting(System.Int32 _settingId,int start, int pageLength, out int count)
		{
			
			return GetBySettingIdFromCompaniesBySetting(null, _settingId, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by SettingID in the
		///		CompaniesBySetting table. Table Companies is related to table Setting
		///		through the (M:N) relationship defined in the CompaniesBySetting table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_settingId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetBySettingIdFromCompaniesBySetting(TransactionManager transactionManager,System.Int32 _settingId, int start, int pageLength, out int count);
		
		#endregion GetBySettingIdFromCompaniesBySetting
		
		#region GetByDriverIdFromDriversByCompanies
		
		/// <summary>
		///		Gets Companies objects from the datasource by DriverID in the
		///		DriversByCompanies table. Table Companies is related to table Drivers
		///		through the (M:N) relationship defined in the DriversByCompanies table.
		/// </summary>
		/// <param name="_driverId"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByDriverIdFromDriversByCompanies(System.Int32 _driverId)
		{
			int count = -1;
			return GetByDriverIdFromDriversByCompanies(null,_driverId, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by DriverID in the
		///		DriversByCompanies table. Table Companies is related to table Drivers
		///		through the (M:N) relationship defined in the DriversByCompanies table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_driverId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetByDriverIdFromDriversByCompanies(System.Int32 _driverId, int start, int pageLength)
		{
			int count = -1;
			return GetByDriverIdFromDriversByCompanies(null, _driverId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by DriverID in the
		///		DriversByCompanies table. Table Companies is related to table Drivers
		///		through the (M:N) relationship defined in the DriversByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_driverId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByDriverIdFromDriversByCompanies(TransactionManager transactionManager, System.Int32 _driverId)
		{
			int count = -1;
			return GetByDriverIdFromDriversByCompanies(transactionManager, _driverId, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by DriverID in the
		///		DriversByCompanies table. Table Companies is related to table Drivers
		///		through the (M:N) relationship defined in the DriversByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_driverId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByDriverIdFromDriversByCompanies(TransactionManager transactionManager, System.Int32 _driverId,int start, int pageLength)
		{
			int count = -1;
			return GetByDriverIdFromDriversByCompanies(transactionManager, _driverId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by DriverID in the
		///		DriversByCompanies table. Table Companies is related to table Drivers
		///		through the (M:N) relationship defined in the DriversByCompanies table.
		/// </summary>
		/// <param name="_driverId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByDriverIdFromDriversByCompanies(System.Int32 _driverId,int start, int pageLength, out int count)
		{
			
			return GetByDriverIdFromDriversByCompanies(null, _driverId, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by DriverID in the
		///		DriversByCompanies table. Table Companies is related to table Drivers
		///		through the (M:N) relationship defined in the DriversByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_driverId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetByDriverIdFromDriversByCompanies(TransactionManager transactionManager,System.Int32 _driverId, int start, int pageLength, out int count);
		
		#endregion GetByDriverIdFromDriversByCompanies
		
		#region GetByNotificationIdFromNotificationsByCompanies
		
		/// <summary>
		///		Gets Companies objects from the datasource by NotificationID in the
		///		NotificationsByCompanies table. Table Companies is related to table Notifications
		///		through the (M:N) relationship defined in the NotificationsByCompanies table.
		/// </summary>
		/// <param name="_notificationId"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByNotificationIdFromNotificationsByCompanies(System.Int32 _notificationId)
		{
			int count = -1;
			return GetByNotificationIdFromNotificationsByCompanies(null,_notificationId, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by NotificationID in the
		///		NotificationsByCompanies table. Table Companies is related to table Notifications
		///		through the (M:N) relationship defined in the NotificationsByCompanies table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_notificationId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetByNotificationIdFromNotificationsByCompanies(System.Int32 _notificationId, int start, int pageLength)
		{
			int count = -1;
			return GetByNotificationIdFromNotificationsByCompanies(null, _notificationId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by NotificationID in the
		///		NotificationsByCompanies table. Table Companies is related to table Notifications
		///		through the (M:N) relationship defined in the NotificationsByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_notificationId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByNotificationIdFromNotificationsByCompanies(TransactionManager transactionManager, System.Int32 _notificationId)
		{
			int count = -1;
			return GetByNotificationIdFromNotificationsByCompanies(transactionManager, _notificationId, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by NotificationID in the
		///		NotificationsByCompanies table. Table Companies is related to table Notifications
		///		through the (M:N) relationship defined in the NotificationsByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_notificationId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByNotificationIdFromNotificationsByCompanies(TransactionManager transactionManager, System.Int32 _notificationId,int start, int pageLength)
		{
			int count = -1;
			return GetByNotificationIdFromNotificationsByCompanies(transactionManager, _notificationId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by NotificationID in the
		///		NotificationsByCompanies table. Table Companies is related to table Notifications
		///		through the (M:N) relationship defined in the NotificationsByCompanies table.
		/// </summary>
		/// <param name="_notificationId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByNotificationIdFromNotificationsByCompanies(System.Int32 _notificationId,int start, int pageLength, out int count)
		{
			
			return GetByNotificationIdFromNotificationsByCompanies(null, _notificationId, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by NotificationID in the
		///		NotificationsByCompanies table. Table Companies is related to table Notifications
		///		through the (M:N) relationship defined in the NotificationsByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_notificationId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetByNotificationIdFromNotificationsByCompanies(TransactionManager transactionManager,System.Int32 _notificationId, int start, int pageLength, out int count);
		
		#endregion GetByNotificationIdFromNotificationsByCompanies
		
		#region GetByScheduleWorkIdFromScheduleWorkByCompanies
		
		/// <summary>
		///		Gets Companies objects from the datasource by ScheduleWorkID in the
		///		ScheduleWorkByCompanies table. Table Companies is related to table ScheduleWork
		///		through the (M:N) relationship defined in the ScheduleWorkByCompanies table.
		/// </summary>
		/// <param name="_scheduleWorkId"></param>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByScheduleWorkIdFromScheduleWorkByCompanies(System.Int32 _scheduleWorkId)
		{
			int count = -1;
			return GetByScheduleWorkIdFromScheduleWorkByCompanies(null,_scheduleWorkId, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets GPSTrackingDBV2.Entities.Companies objects from the datasource by ScheduleWorkID in the
		///		ScheduleWorkByCompanies table. Table Companies is related to table ScheduleWork
		///		through the (M:N) relationship defined in the ScheduleWorkByCompanies table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_scheduleWorkId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public TList<Companies> GetByScheduleWorkIdFromScheduleWorkByCompanies(System.Int32 _scheduleWorkId, int start, int pageLength)
		{
			int count = -1;
			return GetByScheduleWorkIdFromScheduleWorkByCompanies(null, _scheduleWorkId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by ScheduleWorkID in the
		///		ScheduleWorkByCompanies table. Table Companies is related to table ScheduleWork
		///		through the (M:N) relationship defined in the ScheduleWorkByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_scheduleWorkId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByScheduleWorkIdFromScheduleWorkByCompanies(TransactionManager transactionManager, System.Int32 _scheduleWorkId)
		{
			int count = -1;
			return GetByScheduleWorkIdFromScheduleWorkByCompanies(transactionManager, _scheduleWorkId, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets Companies objects from the datasource by ScheduleWorkID in the
		///		ScheduleWorkByCompanies table. Table Companies is related to table ScheduleWork
		///		through the (M:N) relationship defined in the ScheduleWorkByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_scheduleWorkId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByScheduleWorkIdFromScheduleWorkByCompanies(TransactionManager transactionManager, System.Int32 _scheduleWorkId,int start, int pageLength)
		{
			int count = -1;
			return GetByScheduleWorkIdFromScheduleWorkByCompanies(transactionManager, _scheduleWorkId, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets Companies objects from the datasource by ScheduleWorkID in the
		///		ScheduleWorkByCompanies table. Table Companies is related to table ScheduleWork
		///		through the (M:N) relationship defined in the ScheduleWorkByCompanies table.
		/// </summary>
		/// <param name="_scheduleWorkId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Companies objects.</returns>
		public TList<Companies> GetByScheduleWorkIdFromScheduleWorkByCompanies(System.Int32 _scheduleWorkId,int start, int pageLength, out int count)
		{
			
			return GetByScheduleWorkIdFromScheduleWorkByCompanies(null, _scheduleWorkId, start, pageLength, out count);
		}


		/// <summary>
		///		Gets Companies objects from the datasource by ScheduleWorkID in the
		///		ScheduleWorkByCompanies table. Table Companies is related to table ScheduleWork
		///		through the (M:N) relationship defined in the ScheduleWorkByCompanies table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_scheduleWorkId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of Companies objects.</returns>
		public abstract TList<Companies> GetByScheduleWorkIdFromScheduleWorkByCompanies(TransactionManager transactionManager,System.Int32 _scheduleWorkId, int start, int pageLength, out int count);
		
		#endregion GetByScheduleWorkIdFromScheduleWorkByCompanies
		
		#endregion	
		
		#region Delete Methods

		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public override bool Delete(TransactionManager transactionManager, GPSTrackingDBV2.Entities.CompaniesKey key)
		{
			return Delete(transactionManager, key.CompanyId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="_companyId">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(System.Int32 _companyId)
		{
			return Delete(null, _companyId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_companyId">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public abstract bool Delete(TransactionManager transactionManager, System.Int32 _companyId);		
		
		#endregion Delete Methods
		
		#region Get By Foreign Key Functions
		#endregion

		#region Get By Index Functions
		
		/// <summary>
		/// 	Gets a row from the DataSource based on its primary key.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		public override GPSTrackingDBV2.Entities.Companies Get(TransactionManager transactionManager, GPSTrackingDBV2.Entities.CompaniesKey key, int start, int pageLength)
		{
			return GetByCompanyId(transactionManager, key.CompanyId, start, pageLength);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key PK_Companies index.
		/// </summary>
		/// <param name="_companyId"></param>
		/// <returns>Returns an instance of the <see cref="GPSTrackingDBV2.Entities.Companies"/> class.</returns>
		public GPSTrackingDBV2.Entities.Companies GetByCompanyId(System.Int32 _companyId)
		{
			int count = -1;
			return GetByCompanyId(null,_companyId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_Companies index.
		/// </summary>
		/// <param name="_companyId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="GPSTrackingDBV2.Entities.Companies"/> class.</returns>
		public GPSTrackingDBV2.Entities.Companies GetByCompanyId(System.Int32 _companyId, int start, int pageLength)
		{
			int count = -1;
			return GetByCompanyId(null, _companyId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_Companies index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_companyId"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="GPSTrackingDBV2.Entities.Companies"/> class.</returns>
		public GPSTrackingDBV2.Entities.Companies GetByCompanyId(TransactionManager transactionManager, System.Int32 _companyId)
		{
			int count = -1;
			return GetByCompanyId(transactionManager, _companyId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_Companies index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_companyId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="GPSTrackingDBV2.Entities.Companies"/> class.</returns>
		public GPSTrackingDBV2.Entities.Companies GetByCompanyId(TransactionManager transactionManager, System.Int32 _companyId, int start, int pageLength)
		{
			int count = -1;
			return GetByCompanyId(transactionManager, _companyId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_Companies index.
		/// </summary>
		/// <param name="_companyId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="GPSTrackingDBV2.Entities.Companies"/> class.</returns>
		public GPSTrackingDBV2.Entities.Companies GetByCompanyId(System.Int32 _companyId, int start, int pageLength, out int count)
		{
			return GetByCompanyId(null, _companyId, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_Companies index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_companyId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="GPSTrackingDBV2.Entities.Companies"/> class.</returns>
		public abstract GPSTrackingDBV2.Entities.Companies GetByCompanyId(TransactionManager transactionManager, System.Int32 _companyId, int start, int pageLength, out int count);
						
		#endregion "Get By Index Functions"
	
		#region Custom Methods
		
		
		#endregion

		#region Helper Functions	
		
		/// <summary>
		/// Fill a TList&lt;Companies&gt; From a DataReader.
		/// </summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">number of rows.</param>
		/// <returns>a <see cref="TList&lt;Companies&gt;"/></returns>
		public static TList<Companies> Fill(IDataReader reader, TList<Companies> rows, int start, int pageLength)
		{
			NetTiersProvider currentProvider = DataRepository.Provider;
            bool useEntityFactory = currentProvider.UseEntityFactory;
            bool enableEntityTracking = currentProvider.EnableEntityTracking;
            LoadPolicy currentLoadPolicy = currentProvider.CurrentLoadPolicy;
			Type entityCreationFactoryType = currentProvider.EntityCreationalFactoryType;
			
			// advance to the starting row
			for (int i = 0; i < start; i++)
			{
				if (!reader.Read())
				return rows; // not enough rows, just return
			}
			for (int i = 0; i < pageLength; i++)
			{
				if (!reader.Read())
					break; // we are done
					
				string key = null;
				
				GPSTrackingDBV2.Entities.Companies c = null;
				if (useEntityFactory)
				{
					key = new System.Text.StringBuilder("Companies")
					.Append("|").Append((System.Int32)reader[((int)CompaniesColumn.CompanyId - 1)]).ToString();
					c = EntityManager.LocateOrCreate<Companies>(
					key.ToString(), // EntityTrackingKey
					"Companies",  //Creational Type
					entityCreationFactoryType,  //Factory used to create entity
					enableEntityTracking); // Track this entity?
				}
				else
				{
					c = new GPSTrackingDBV2.Entities.Companies();
				}
				
				if (!enableEntityTracking ||
					c.EntityState == EntityState.Added ||
					(enableEntityTracking &&
					
						(
							(currentLoadPolicy == LoadPolicy.PreserveChanges && c.EntityState == EntityState.Unchanged) ||
							(currentLoadPolicy == LoadPolicy.DiscardChanges && c.EntityState != EntityState.Unchanged)
						)
					))
				{
					c.SuppressEntityEvents = true;
					c.CompanyId = (System.Int32)reader[((int)CompaniesColumn.CompanyId - 1)];
					c.OriginalCompanyId = c.CompanyId;
					c.Name = (System.String)reader[((int)CompaniesColumn.Name - 1)];
					c.Logo = (System.String)reader[((int)CompaniesColumn.Logo - 1)];
					c.Guid = (System.String)reader[((int)CompaniesColumn.Guid - 1)];
					c.EntityTrackingKey = key;
					c.AcceptChanges();
					c.SuppressEntityEvents = false;
				}
				rows.Add(c);
			}
		return rows;
		}		
		/// <summary>
		/// Refreshes the <see cref="GPSTrackingDBV2.Entities.Companies"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="GPSTrackingDBV2.Entities.Companies"/> object to refresh.</param>
		public static void RefreshEntity(IDataReader reader, GPSTrackingDBV2.Entities.Companies entity)
		{
			if (!reader.Read()) return;
			
			entity.CompanyId = (System.Int32)reader[((int)CompaniesColumn.CompanyId - 1)];
			entity.OriginalCompanyId = (System.Int32)reader["CompanyID"];
			entity.Name = (System.String)reader[((int)CompaniesColumn.Name - 1)];
			entity.Logo = (System.String)reader[((int)CompaniesColumn.Logo - 1)];
			entity.Guid = (System.String)reader[((int)CompaniesColumn.Guid - 1)];
			entity.AcceptChanges();
		}
		
		/// <summary>
		/// Refreshes the <see cref="GPSTrackingDBV2.Entities.Companies"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="GPSTrackingDBV2.Entities.Companies"/> object.</param>
		public static void RefreshEntity(DataSet dataSet, GPSTrackingDBV2.Entities.Companies entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.CompanyId = (System.Int32)dataRow["CompanyID"];
			entity.OriginalCompanyId = (System.Int32)dataRow["CompanyID"];
			entity.Name = (System.String)dataRow["Name"];
			entity.Logo = (System.String)dataRow["Logo"];
			entity.Guid = (System.String)dataRow["GUID"];
			entity.AcceptChanges();
		}
		#endregion 
		
		#region DeepLoad Methods
		/// <summary>
		/// Deep Loads the <see cref="IEntity"/> object with criteria based of the child 
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		/// </summary>
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">The <see cref="GPSTrackingDBV2.Entities.Companies"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">GPSTrackingDBV2.Entities.Companies Property Collection Type Array To Include or Exclude from Load</param>
		/// <param name="innerList">A collection of child types for easy access.</param>
	    /// <exception cref="ArgumentNullException">entity or childTypes is null.</exception>
	    /// <exception cref="ArgumentException">deepLoadType has invalid value.</exception>
		public override void DeepLoad(TransactionManager transactionManager, GPSTrackingDBV2.Entities.Companies entity, bool deep, DeepLoadType deepLoadType, System.Type[] childTypes, DeepSession innerList)
		{
			if(entity == null)
				return;
			
			//used to hold DeepLoad method delegates and fire after all the local children have been loaded.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			// Deep load child collections  - Call GetByCompanyId methods when available
			
			#region SettingIdSettingCollection_From_CompaniesBySetting
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<Setting>|SettingIdSettingCollection_From_CompaniesBySetting", deepLoadType, innerList))
			{
				entity.SettingIdSettingCollection_From_CompaniesBySetting = DataRepository.SettingProvider.GetByCompanyIdFromCompaniesBySetting(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'SettingIdSettingCollection_From_CompaniesBySetting' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.SettingIdSettingCollection_From_CompaniesBySetting != null)
				{
					deepHandles.Add("SettingIdSettingCollection_From_CompaniesBySetting",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< Setting >) DataRepository.SettingProvider.DeepLoad,
						new object[] { transactionManager, entity.SettingIdSettingCollection_From_CompaniesBySetting, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<AdministratorsRoles>|AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles", deepLoadType, innerList))
			{
				entity.AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles = DataRepository.AdministratorsRolesProvider.GetByCompanyIdFromCompaniesByAdministratorsRoles(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles != null)
				{
					deepHandles.Add("AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< AdministratorsRoles >) DataRepository.AdministratorsRolesProvider.DeepLoad,
						new object[] { transactionManager, entity.AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region CompaniesByDepartmentsCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<CompaniesByDepartments>|CompaniesByDepartmentsCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'CompaniesByDepartmentsCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.CompaniesByDepartmentsCollection = DataRepository.CompaniesByDepartmentsProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.CompaniesByDepartmentsCollection.Count > 0)
				{
					deepHandles.Add("CompaniesByDepartmentsCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<CompaniesByDepartments>) DataRepository.CompaniesByDepartmentsProvider.DeepLoad,
						new object[] { transactionManager, entity.CompaniesByDepartmentsCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<GeoFences>|GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences", deepLoadType, innerList))
			{
				entity.GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences = DataRepository.GeoFencesProvider.GetByCompanyIdFromCompaniesByGeoFences(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences != null)
				{
					deepHandles.Add("GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< GeoFences >) DataRepository.GeoFencesProvider.DeepLoad,
						new object[] { transactionManager, entity.GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region CompaniesByGeoFencesCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<CompaniesByGeoFences>|CompaniesByGeoFencesCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'CompaniesByGeoFencesCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.CompaniesByGeoFencesCollection = DataRepository.CompaniesByGeoFencesProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.CompaniesByGeoFencesCollection.Count > 0)
				{
					deepHandles.Add("CompaniesByGeoFencesCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<CompaniesByGeoFences>) DataRepository.CompaniesByGeoFencesProvider.DeepLoad,
						new object[] { transactionManager, entity.CompaniesByGeoFencesCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region UsersCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<Users>|UsersCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'UsersCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.UsersCollection = DataRepository.UsersProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.UsersCollection.Count > 0)
				{
					deepHandles.Add("UsersCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<Users>) DataRepository.UsersProvider.DeepLoad,
						new object[] { transactionManager, entity.UsersCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region NotificationsByCompaniesCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<NotificationsByCompanies>|NotificationsByCompaniesCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'NotificationsByCompaniesCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.NotificationsByCompaniesCollection = DataRepository.NotificationsByCompaniesProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.NotificationsByCompaniesCollection.Count > 0)
				{
					deepHandles.Add("NotificationsByCompaniesCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<NotificationsByCompanies>) DataRepository.NotificationsByCompaniesProvider.DeepLoad,
						new object[] { transactionManager, entity.NotificationsByCompaniesCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region MasterUsernameMastersCollection_From_CompaniesByMasters
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<Masters>|MasterUsernameMastersCollection_From_CompaniesByMasters", deepLoadType, innerList))
			{
				entity.MasterUsernameMastersCollection_From_CompaniesByMasters = DataRepository.MastersProvider.GetByCompanyIdFromCompaniesByMasters(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'MasterUsernameMastersCollection_From_CompaniesByMasters' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.MasterUsernameMastersCollection_From_CompaniesByMasters != null)
				{
					deepHandles.Add("MasterUsernameMastersCollection_From_CompaniesByMasters",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< Masters >) DataRepository.MastersProvider.DeepLoad,
						new object[] { transactionManager, entity.MasterUsernameMastersCollection_From_CompaniesByMasters, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region CompaniesByMenuCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<CompaniesByMenu>|CompaniesByMenuCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'CompaniesByMenuCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.CompaniesByMenuCollection = DataRepository.CompaniesByMenuProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.CompaniesByMenuCollection.Count > 0)
				{
					deepHandles.Add("CompaniesByMenuCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<CompaniesByMenu>) DataRepository.CompaniesByMenuProvider.DeepLoad,
						new object[] { transactionManager, entity.CompaniesByMenuCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region ScheduleWorkByCompaniesCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<ScheduleWorkByCompanies>|ScheduleWorkByCompaniesCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ScheduleWorkByCompaniesCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.ScheduleWorkByCompaniesCollection = DataRepository.ScheduleWorkByCompaniesProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.ScheduleWorkByCompaniesCollection.Count > 0)
				{
					deepHandles.Add("ScheduleWorkByCompaniesCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<ScheduleWorkByCompanies>) DataRepository.ScheduleWorkByCompaniesProvider.DeepLoad,
						new object[] { transactionManager, entity.ScheduleWorkByCompaniesCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region OrderCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<Order>|OrderCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'OrderCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.OrderCollection = DataRepository.OrderProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.OrderCollection.Count > 0)
				{
					deepHandles.Add("OrderCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<Order>) DataRepository.OrderProvider.DeepLoad,
						new object[] { transactionManager, entity.OrderCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region CompaniesByGpsGroupsCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<CompaniesByGpsGroups>|CompaniesByGpsGroupsCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'CompaniesByGpsGroupsCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.CompaniesByGpsGroupsCollection = DataRepository.CompaniesByGpsGroupsProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.CompaniesByGpsGroupsCollection.Count > 0)
				{
					deepHandles.Add("CompaniesByGpsGroupsCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<CompaniesByGpsGroups>) DataRepository.CompaniesByGpsGroupsProvider.DeepLoad,
						new object[] { transactionManager, entity.CompaniesByGpsGroupsCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region CompaniesBySettingCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<CompaniesBySetting>|CompaniesBySettingCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'CompaniesBySettingCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.CompaniesBySettingCollection = DataRepository.CompaniesBySettingProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.CompaniesBySettingCollection.Count > 0)
				{
					deepHandles.Add("CompaniesBySettingCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<CompaniesBySetting>) DataRepository.CompaniesBySettingProvider.DeepLoad,
						new object[] { transactionManager, entity.CompaniesBySettingCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region CompaniesByAdministratorsRolesCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<CompaniesByAdministratorsRoles>|CompaniesByAdministratorsRolesCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'CompaniesByAdministratorsRolesCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.CompaniesByAdministratorsRolesCollection = DataRepository.CompaniesByAdministratorsRolesProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.CompaniesByAdministratorsRolesCollection.Count > 0)
				{
					deepHandles.Add("CompaniesByAdministratorsRolesCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<CompaniesByAdministratorsRoles>) DataRepository.CompaniesByAdministratorsRolesProvider.DeepLoad,
						new object[] { transactionManager, entity.CompaniesByAdministratorsRolesCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region DriverIdDriversCollection_From_DriversByCompanies
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<Drivers>|DriverIdDriversCollection_From_DriversByCompanies", deepLoadType, innerList))
			{
				entity.DriverIdDriversCollection_From_DriversByCompanies = DataRepository.DriversProvider.GetByCompanyIdFromDriversByCompanies(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'DriverIdDriversCollection_From_DriversByCompanies' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.DriverIdDriversCollection_From_DriversByCompanies != null)
				{
					deepHandles.Add("DriverIdDriversCollection_From_DriversByCompanies",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< Drivers >) DataRepository.DriversProvider.DeepLoad,
						new object[] { transactionManager, entity.DriverIdDriversCollection_From_DriversByCompanies, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region CompaniesByMastersCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<CompaniesByMasters>|CompaniesByMastersCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'CompaniesByMastersCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.CompaniesByMastersCollection = DataRepository.CompaniesByMastersProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.CompaniesByMastersCollection.Count > 0)
				{
					deepHandles.Add("CompaniesByMastersCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<CompaniesByMasters>) DataRepository.CompaniesByMastersProvider.DeepLoad,
						new object[] { transactionManager, entity.CompaniesByMastersCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region DriversByCompaniesCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<DriversByCompanies>|DriversByCompaniesCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'DriversByCompaniesCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.DriversByCompaniesCollection = DataRepository.DriversByCompaniesProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.DriversByCompaniesCollection.Count > 0)
				{
					deepHandles.Add("DriversByCompaniesCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<DriversByCompanies>) DataRepository.DriversByCompaniesProvider.DeepLoad,
						new object[] { transactionManager, entity.DriversByCompaniesCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<GpsGroups>|GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups", deepLoadType, innerList))
			{
				entity.GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups = DataRepository.GpsGroupsProvider.GetByCompanyIdFromCompaniesByGpsGroups(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups != null)
				{
					deepHandles.Add("GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< GpsGroups >) DataRepository.GpsGroupsProvider.DeepLoad,
						new object[] { transactionManager, entity.GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region LogCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<Log>|LogCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'LogCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.LogCollection = DataRepository.LogProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.LogCollection.Count > 0)
				{
					deepHandles.Add("LogCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<Log>) DataRepository.LogProvider.DeepLoad,
						new object[] { transactionManager, entity.LogCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region AdministratorsCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<Administrators>|AdministratorsCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'AdministratorsCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.AdministratorsCollection = DataRepository.AdministratorsProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.AdministratorsCollection.Count > 0)
				{
					deepHandles.Add("AdministratorsCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<Administrators>) DataRepository.AdministratorsProvider.DeepLoad,
						new object[] { transactionManager, entity.AdministratorsCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region StockCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<Stock>|StockCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'StockCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.StockCollection = DataRepository.StockProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.StockCollection.Count > 0)
				{
					deepHandles.Add("StockCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<Stock>) DataRepository.StockProvider.DeepLoad,
						new object[] { transactionManager, entity.StockCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region DepartmentIdDepartmentsCollection_From_CompaniesByDepartments
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<Departments>|DepartmentIdDepartmentsCollection_From_CompaniesByDepartments", deepLoadType, innerList))
			{
				entity.DepartmentIdDepartmentsCollection_From_CompaniesByDepartments = DataRepository.DepartmentsProvider.GetByCompanyIdFromCompaniesByDepartments(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'DepartmentIdDepartmentsCollection_From_CompaniesByDepartments' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.DepartmentIdDepartmentsCollection_From_CompaniesByDepartments != null)
				{
					deepHandles.Add("DepartmentIdDepartmentsCollection_From_CompaniesByDepartments",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< Departments >) DataRepository.DepartmentsProvider.DeepLoad,
						new object[] { transactionManager, entity.DepartmentIdDepartmentsCollection_From_CompaniesByDepartments, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region ClientsGroupsByCompaniesCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<ClientsGroupsByCompanies>|ClientsGroupsByCompaniesCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ClientsGroupsByCompaniesCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.ClientsGroupsByCompaniesCollection = DataRepository.ClientsGroupsByCompaniesProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.ClientsGroupsByCompaniesCollection.Count > 0)
				{
					deepHandles.Add("ClientsGroupsByCompaniesCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<ClientsGroupsByCompanies>) DataRepository.ClientsGroupsByCompaniesProvider.DeepLoad,
						new object[] { transactionManager, entity.ClientsGroupsByCompaniesCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region BusRouteByCompaniesCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<BusRouteByCompanies>|BusRouteByCompaniesCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'BusRouteByCompaniesCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.BusRouteByCompaniesCollection = DataRepository.BusRouteByCompaniesProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.BusRouteByCompaniesCollection.Count > 0)
				{
					deepHandles.Add("BusRouteByCompaniesCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<BusRouteByCompanies>) DataRepository.BusRouteByCompaniesProvider.DeepLoad,
						new object[] { transactionManager, entity.BusRouteByCompaniesCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<ScheduleWork>|ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies", deepLoadType, innerList))
			{
				entity.ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies = DataRepository.ScheduleWorkProvider.GetByCompanyIdFromScheduleWorkByCompanies(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies != null)
				{
					deepHandles.Add("ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< ScheduleWork >) DataRepository.ScheduleWorkProvider.DeepLoad,
						new object[] { transactionManager, entity.ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region MenuIdMenuCollection_From_CompaniesByMenu
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<Menu>|MenuIdMenuCollection_From_CompaniesByMenu", deepLoadType, innerList))
			{
				entity.MenuIdMenuCollection_From_CompaniesByMenu = DataRepository.MenuProvider.GetByCompanyIdFromCompaniesByMenu(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'MenuIdMenuCollection_From_CompaniesByMenu' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.MenuIdMenuCollection_From_CompaniesByMenu != null)
				{
					deepHandles.Add("MenuIdMenuCollection_From_CompaniesByMenu",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< Menu >) DataRepository.MenuProvider.DeepLoad,
						new object[] { transactionManager, entity.MenuIdMenuCollection_From_CompaniesByMenu, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region BusRouteIdBusRoutesCollection_From_BusRouteByCompanies
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<BusRoutes>|BusRouteIdBusRoutesCollection_From_BusRouteByCompanies", deepLoadType, innerList))
			{
				entity.BusRouteIdBusRoutesCollection_From_BusRouteByCompanies = DataRepository.BusRoutesProvider.GetByCompanyIdFromBusRouteByCompanies(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'BusRouteIdBusRoutesCollection_From_BusRouteByCompanies' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.BusRouteIdBusRoutesCollection_From_BusRouteByCompanies != null)
				{
					deepHandles.Add("BusRouteIdBusRoutesCollection_From_BusRouteByCompanies",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< BusRoutes >) DataRepository.BusRoutesProvider.DeepLoad,
						new object[] { transactionManager, entity.BusRouteIdBusRoutesCollection_From_BusRouteByCompanies, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region EmailToSendStocksCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<EmailToSendStocks>|EmailToSendStocksCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'EmailToSendStocksCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.EmailToSendStocksCollection = DataRepository.EmailToSendStocksProvider.GetByCompanyId(transactionManager, entity.CompanyId);

				if (deep && entity.EmailToSendStocksCollection.Count > 0)
				{
					deepHandles.Add("EmailToSendStocksCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<EmailToSendStocks>) DataRepository.EmailToSendStocksProvider.DeepLoad,
						new object[] { transactionManager, entity.EmailToSendStocksCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region NotificationIdNotificationsCollection_From_NotificationsByCompanies
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<Notifications>|NotificationIdNotificationsCollection_From_NotificationsByCompanies", deepLoadType, innerList))
			{
				entity.NotificationIdNotificationsCollection_From_NotificationsByCompanies = DataRepository.NotificationsProvider.GetByCompanyIdFromNotificationsByCompanies(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'NotificationIdNotificationsCollection_From_NotificationsByCompanies' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.NotificationIdNotificationsCollection_From_NotificationsByCompanies != null)
				{
					deepHandles.Add("NotificationIdNotificationsCollection_From_NotificationsByCompanies",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< Notifications >) DataRepository.NotificationsProvider.DeepLoad,
						new object[] { transactionManager, entity.NotificationIdNotificationsCollection_From_NotificationsByCompanies, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<ClientsGroups>|ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies", deepLoadType, innerList))
			{
				entity.ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies = DataRepository.ClientsGroupsProvider.GetByCompanyIdFromClientsGroupsByCompanies(transactionManager, entity.CompanyId);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies != null)
				{
					deepHandles.Add("ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< ClientsGroups >) DataRepository.ClientsGroupsProvider.DeepLoad,
						new object[] { transactionManager, entity.ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			//Fire all DeepLoad Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			deepHandles = null;
		}
		
		#endregion 
		
		#region DeepSave Methods

		/// <summary>
		/// Deep Save the entire object graph of the GPSTrackingDBV2.Entities.Companies object with criteria based of the child 
		/// Type property array and DeepSaveType.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entity">GPSTrackingDBV2.Entities.Companies instance</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">GPSTrackingDBV2.Entities.Companies Property Collection Type Array To Include or Exclude from Save</param>
		/// <param name="innerList">A Hashtable of child types for easy access.</param>
		public override bool DeepSave(TransactionManager transactionManager, GPSTrackingDBV2.Entities.Companies entity, DeepSaveType deepSaveType, System.Type[] childTypes, DeepSession innerList)
		{	
			if (entity == null)
				return false;
							
			#region Composite Parent Properties
			//Save Source Composite Properties, however, don't call deep save on them.  
			//So they only get saved a single level deep.
			#endregion Composite Parent Properties

			// Save Root Entity through Provider
			if (!entity.IsDeleted)
				this.Save(transactionManager, entity);
			
			//used to hold DeepSave method delegates and fire after all the local children have been saved.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();

			#region SettingIdSettingCollection_From_CompaniesBySetting>
			if (CanDeepSave(entity.SettingIdSettingCollection_From_CompaniesBySetting, "List<Setting>|SettingIdSettingCollection_From_CompaniesBySetting", deepSaveType, innerList))
			{
				if (entity.SettingIdSettingCollection_From_CompaniesBySetting.Count > 0 || entity.SettingIdSettingCollection_From_CompaniesBySetting.DeletedItems.Count > 0)
				{
					DataRepository.SettingProvider.Save(transactionManager, entity.SettingIdSettingCollection_From_CompaniesBySetting); 
					deepHandles.Add("SettingIdSettingCollection_From_CompaniesBySetting",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<Setting>) DataRepository.SettingProvider.DeepSave,
						new object[] { transactionManager, entity.SettingIdSettingCollection_From_CompaniesBySetting, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles>
			if (CanDeepSave(entity.AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles, "List<AdministratorsRoles>|AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles", deepSaveType, innerList))
			{
				if (entity.AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles.Count > 0 || entity.AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles.DeletedItems.Count > 0)
				{
					DataRepository.AdministratorsRolesProvider.Save(transactionManager, entity.AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles); 
					deepHandles.Add("AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<AdministratorsRoles>) DataRepository.AdministratorsRolesProvider.DeepSave,
						new object[] { transactionManager, entity.AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences>
			if (CanDeepSave(entity.GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences, "List<GeoFences>|GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences", deepSaveType, innerList))
			{
				if (entity.GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences.Count > 0 || entity.GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences.DeletedItems.Count > 0)
				{
					DataRepository.GeoFencesProvider.Save(transactionManager, entity.GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences); 
					deepHandles.Add("GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<GeoFences>) DataRepository.GeoFencesProvider.DeepSave,
						new object[] { transactionManager, entity.GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region MasterUsernameMastersCollection_From_CompaniesByMasters>
			if (CanDeepSave(entity.MasterUsernameMastersCollection_From_CompaniesByMasters, "List<Masters>|MasterUsernameMastersCollection_From_CompaniesByMasters", deepSaveType, innerList))
			{
				if (entity.MasterUsernameMastersCollection_From_CompaniesByMasters.Count > 0 || entity.MasterUsernameMastersCollection_From_CompaniesByMasters.DeletedItems.Count > 0)
				{
					DataRepository.MastersProvider.Save(transactionManager, entity.MasterUsernameMastersCollection_From_CompaniesByMasters); 
					deepHandles.Add("MasterUsernameMastersCollection_From_CompaniesByMasters",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<Masters>) DataRepository.MastersProvider.DeepSave,
						new object[] { transactionManager, entity.MasterUsernameMastersCollection_From_CompaniesByMasters, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region DriverIdDriversCollection_From_DriversByCompanies>
			if (CanDeepSave(entity.DriverIdDriversCollection_From_DriversByCompanies, "List<Drivers>|DriverIdDriversCollection_From_DriversByCompanies", deepSaveType, innerList))
			{
				if (entity.DriverIdDriversCollection_From_DriversByCompanies.Count > 0 || entity.DriverIdDriversCollection_From_DriversByCompanies.DeletedItems.Count > 0)
				{
					DataRepository.DriversProvider.Save(transactionManager, entity.DriverIdDriversCollection_From_DriversByCompanies); 
					deepHandles.Add("DriverIdDriversCollection_From_DriversByCompanies",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<Drivers>) DataRepository.DriversProvider.DeepSave,
						new object[] { transactionManager, entity.DriverIdDriversCollection_From_DriversByCompanies, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups>
			if (CanDeepSave(entity.GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups, "List<GpsGroups>|GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups", deepSaveType, innerList))
			{
				if (entity.GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups.Count > 0 || entity.GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups.DeletedItems.Count > 0)
				{
					DataRepository.GpsGroupsProvider.Save(transactionManager, entity.GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups); 
					deepHandles.Add("GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<GpsGroups>) DataRepository.GpsGroupsProvider.DeepSave,
						new object[] { transactionManager, entity.GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region DepartmentIdDepartmentsCollection_From_CompaniesByDepartments>
			if (CanDeepSave(entity.DepartmentIdDepartmentsCollection_From_CompaniesByDepartments, "List<Departments>|DepartmentIdDepartmentsCollection_From_CompaniesByDepartments", deepSaveType, innerList))
			{
				if (entity.DepartmentIdDepartmentsCollection_From_CompaniesByDepartments.Count > 0 || entity.DepartmentIdDepartmentsCollection_From_CompaniesByDepartments.DeletedItems.Count > 0)
				{
					DataRepository.DepartmentsProvider.Save(transactionManager, entity.DepartmentIdDepartmentsCollection_From_CompaniesByDepartments); 
					deepHandles.Add("DepartmentIdDepartmentsCollection_From_CompaniesByDepartments",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<Departments>) DataRepository.DepartmentsProvider.DeepSave,
						new object[] { transactionManager, entity.DepartmentIdDepartmentsCollection_From_CompaniesByDepartments, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies>
			if (CanDeepSave(entity.ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies, "List<ScheduleWork>|ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies", deepSaveType, innerList))
			{
				if (entity.ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies.Count > 0 || entity.ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies.DeletedItems.Count > 0)
				{
					DataRepository.ScheduleWorkProvider.Save(transactionManager, entity.ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies); 
					deepHandles.Add("ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<ScheduleWork>) DataRepository.ScheduleWorkProvider.DeepSave,
						new object[] { transactionManager, entity.ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region MenuIdMenuCollection_From_CompaniesByMenu>
			if (CanDeepSave(entity.MenuIdMenuCollection_From_CompaniesByMenu, "List<Menu>|MenuIdMenuCollection_From_CompaniesByMenu", deepSaveType, innerList))
			{
				if (entity.MenuIdMenuCollection_From_CompaniesByMenu.Count > 0 || entity.MenuIdMenuCollection_From_CompaniesByMenu.DeletedItems.Count > 0)
				{
					DataRepository.MenuProvider.Save(transactionManager, entity.MenuIdMenuCollection_From_CompaniesByMenu); 
					deepHandles.Add("MenuIdMenuCollection_From_CompaniesByMenu",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<Menu>) DataRepository.MenuProvider.DeepSave,
						new object[] { transactionManager, entity.MenuIdMenuCollection_From_CompaniesByMenu, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region BusRouteIdBusRoutesCollection_From_BusRouteByCompanies>
			if (CanDeepSave(entity.BusRouteIdBusRoutesCollection_From_BusRouteByCompanies, "List<BusRoutes>|BusRouteIdBusRoutesCollection_From_BusRouteByCompanies", deepSaveType, innerList))
			{
				if (entity.BusRouteIdBusRoutesCollection_From_BusRouteByCompanies.Count > 0 || entity.BusRouteIdBusRoutesCollection_From_BusRouteByCompanies.DeletedItems.Count > 0)
				{
					DataRepository.BusRoutesProvider.Save(transactionManager, entity.BusRouteIdBusRoutesCollection_From_BusRouteByCompanies); 
					deepHandles.Add("BusRouteIdBusRoutesCollection_From_BusRouteByCompanies",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<BusRoutes>) DataRepository.BusRoutesProvider.DeepSave,
						new object[] { transactionManager, entity.BusRouteIdBusRoutesCollection_From_BusRouteByCompanies, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region NotificationIdNotificationsCollection_From_NotificationsByCompanies>
			if (CanDeepSave(entity.NotificationIdNotificationsCollection_From_NotificationsByCompanies, "List<Notifications>|NotificationIdNotificationsCollection_From_NotificationsByCompanies", deepSaveType, innerList))
			{
				if (entity.NotificationIdNotificationsCollection_From_NotificationsByCompanies.Count > 0 || entity.NotificationIdNotificationsCollection_From_NotificationsByCompanies.DeletedItems.Count > 0)
				{
					DataRepository.NotificationsProvider.Save(transactionManager, entity.NotificationIdNotificationsCollection_From_NotificationsByCompanies); 
					deepHandles.Add("NotificationIdNotificationsCollection_From_NotificationsByCompanies",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<Notifications>) DataRepository.NotificationsProvider.DeepSave,
						new object[] { transactionManager, entity.NotificationIdNotificationsCollection_From_NotificationsByCompanies, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies>
			if (CanDeepSave(entity.ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies, "List<ClientsGroups>|ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies", deepSaveType, innerList))
			{
				if (entity.ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies.Count > 0 || entity.ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies.DeletedItems.Count > 0)
				{
					DataRepository.ClientsGroupsProvider.Save(transactionManager, entity.ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies); 
					deepHandles.Add("ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<ClientsGroups>) DataRepository.ClientsGroupsProvider.DeepSave,
						new object[] { transactionManager, entity.ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 
	
			#region List<CompaniesByDepartments>
				if (CanDeepSave(entity.CompaniesByDepartmentsCollection, "List<CompaniesByDepartments>|CompaniesByDepartmentsCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(CompaniesByDepartments child in entity.CompaniesByDepartmentsCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.DepartmentIdSource != null)
						{
								child.DepartmentId = child.DepartmentIdSource.DepartmentId;
						}

					}

					if (entity.CompaniesByDepartmentsCollection.Count > 0 || entity.CompaniesByDepartmentsCollection.DeletedItems.Count > 0)
					{
						//DataRepository.CompaniesByDepartmentsProvider.Save(transactionManager, entity.CompaniesByDepartmentsCollection);
						
						deepHandles.Add("CompaniesByDepartmentsCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< CompaniesByDepartments >) DataRepository.CompaniesByDepartmentsProvider.DeepSave,
							new object[] { transactionManager, entity.CompaniesByDepartmentsCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<CompaniesByGeoFences>
				if (CanDeepSave(entity.CompaniesByGeoFencesCollection, "List<CompaniesByGeoFences>|CompaniesByGeoFencesCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(CompaniesByGeoFences child in entity.CompaniesByGeoFencesCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.GeoFenceIdSource != null)
						{
								child.GeoFenceId = child.GeoFenceIdSource.GeoFenceId;
						}

					}

					if (entity.CompaniesByGeoFencesCollection.Count > 0 || entity.CompaniesByGeoFencesCollection.DeletedItems.Count > 0)
					{
						//DataRepository.CompaniesByGeoFencesProvider.Save(transactionManager, entity.CompaniesByGeoFencesCollection);
						
						deepHandles.Add("CompaniesByGeoFencesCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< CompaniesByGeoFences >) DataRepository.CompaniesByGeoFencesProvider.DeepSave,
							new object[] { transactionManager, entity.CompaniesByGeoFencesCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<Users>
				if (CanDeepSave(entity.UsersCollection, "List<Users>|UsersCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(Users child in entity.UsersCollection)
					{
						if(child.CompanyIdSource != null)
						{
							child.CompanyId = child.CompanyIdSource.CompanyId;
						}
						else
						{
							child.CompanyId = entity.CompanyId;
						}

					}

					if (entity.UsersCollection.Count > 0 || entity.UsersCollection.DeletedItems.Count > 0)
					{
						//DataRepository.UsersProvider.Save(transactionManager, entity.UsersCollection);
						
						deepHandles.Add("UsersCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< Users >) DataRepository.UsersProvider.DeepSave,
							new object[] { transactionManager, entity.UsersCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<NotificationsByCompanies>
				if (CanDeepSave(entity.NotificationsByCompaniesCollection, "List<NotificationsByCompanies>|NotificationsByCompaniesCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(NotificationsByCompanies child in entity.NotificationsByCompaniesCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.NotificationIdSource != null)
						{
								child.NotificationId = child.NotificationIdSource.NotificationId;
						}

					}

					if (entity.NotificationsByCompaniesCollection.Count > 0 || entity.NotificationsByCompaniesCollection.DeletedItems.Count > 0)
					{
						//DataRepository.NotificationsByCompaniesProvider.Save(transactionManager, entity.NotificationsByCompaniesCollection);
						
						deepHandles.Add("NotificationsByCompaniesCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< NotificationsByCompanies >) DataRepository.NotificationsByCompaniesProvider.DeepSave,
							new object[] { transactionManager, entity.NotificationsByCompaniesCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<CompaniesByMenu>
				if (CanDeepSave(entity.CompaniesByMenuCollection, "List<CompaniesByMenu>|CompaniesByMenuCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(CompaniesByMenu child in entity.CompaniesByMenuCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.MenuIdSource != null)
						{
								child.MenuId = child.MenuIdSource.MenuId;
						}

					}

					if (entity.CompaniesByMenuCollection.Count > 0 || entity.CompaniesByMenuCollection.DeletedItems.Count > 0)
					{
						//DataRepository.CompaniesByMenuProvider.Save(transactionManager, entity.CompaniesByMenuCollection);
						
						deepHandles.Add("CompaniesByMenuCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< CompaniesByMenu >) DataRepository.CompaniesByMenuProvider.DeepSave,
							new object[] { transactionManager, entity.CompaniesByMenuCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<ScheduleWorkByCompanies>
				if (CanDeepSave(entity.ScheduleWorkByCompaniesCollection, "List<ScheduleWorkByCompanies>|ScheduleWorkByCompaniesCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(ScheduleWorkByCompanies child in entity.ScheduleWorkByCompaniesCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.ScheduleWorkIdSource != null)
						{
								child.ScheduleWorkId = child.ScheduleWorkIdSource.ScheduleWorkId;
						}

					}

					if (entity.ScheduleWorkByCompaniesCollection.Count > 0 || entity.ScheduleWorkByCompaniesCollection.DeletedItems.Count > 0)
					{
						//DataRepository.ScheduleWorkByCompaniesProvider.Save(transactionManager, entity.ScheduleWorkByCompaniesCollection);
						
						deepHandles.Add("ScheduleWorkByCompaniesCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< ScheduleWorkByCompanies >) DataRepository.ScheduleWorkByCompaniesProvider.DeepSave,
							new object[] { transactionManager, entity.ScheduleWorkByCompaniesCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<Order>
				if (CanDeepSave(entity.OrderCollection, "List<Order>|OrderCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(Order child in entity.OrderCollection)
					{
						if(child.CompanyIdSource != null)
						{
							child.CompanyId = child.CompanyIdSource.CompanyId;
						}
						else
						{
							child.CompanyId = entity.CompanyId;
						}

					}

					if (entity.OrderCollection.Count > 0 || entity.OrderCollection.DeletedItems.Count > 0)
					{
						//DataRepository.OrderProvider.Save(transactionManager, entity.OrderCollection);
						
						deepHandles.Add("OrderCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< Order >) DataRepository.OrderProvider.DeepSave,
							new object[] { transactionManager, entity.OrderCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<CompaniesByGpsGroups>
				if (CanDeepSave(entity.CompaniesByGpsGroupsCollection, "List<CompaniesByGpsGroups>|CompaniesByGpsGroupsCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(CompaniesByGpsGroups child in entity.CompaniesByGpsGroupsCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.GpsGroupIdSource != null)
						{
								child.GpsGroupId = child.GpsGroupIdSource.GpsGroupId;
						}

					}

					if (entity.CompaniesByGpsGroupsCollection.Count > 0 || entity.CompaniesByGpsGroupsCollection.DeletedItems.Count > 0)
					{
						//DataRepository.CompaniesByGpsGroupsProvider.Save(transactionManager, entity.CompaniesByGpsGroupsCollection);
						
						deepHandles.Add("CompaniesByGpsGroupsCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< CompaniesByGpsGroups >) DataRepository.CompaniesByGpsGroupsProvider.DeepSave,
							new object[] { transactionManager, entity.CompaniesByGpsGroupsCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<CompaniesBySetting>
				if (CanDeepSave(entity.CompaniesBySettingCollection, "List<CompaniesBySetting>|CompaniesBySettingCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(CompaniesBySetting child in entity.CompaniesBySettingCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.SettingIdSource != null)
						{
								child.SettingId = child.SettingIdSource.SettingId;
						}

					}

					if (entity.CompaniesBySettingCollection.Count > 0 || entity.CompaniesBySettingCollection.DeletedItems.Count > 0)
					{
						//DataRepository.CompaniesBySettingProvider.Save(transactionManager, entity.CompaniesBySettingCollection);
						
						deepHandles.Add("CompaniesBySettingCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< CompaniesBySetting >) DataRepository.CompaniesBySettingProvider.DeepSave,
							new object[] { transactionManager, entity.CompaniesBySettingCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<CompaniesByAdministratorsRoles>
				if (CanDeepSave(entity.CompaniesByAdministratorsRolesCollection, "List<CompaniesByAdministratorsRoles>|CompaniesByAdministratorsRolesCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(CompaniesByAdministratorsRoles child in entity.CompaniesByAdministratorsRolesCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.AdministratorRoleIdSource != null)
						{
								child.AdministratorRoleId = child.AdministratorRoleIdSource.AdministratorRoleId;
						}

					}

					if (entity.CompaniesByAdministratorsRolesCollection.Count > 0 || entity.CompaniesByAdministratorsRolesCollection.DeletedItems.Count > 0)
					{
						//DataRepository.CompaniesByAdministratorsRolesProvider.Save(transactionManager, entity.CompaniesByAdministratorsRolesCollection);
						
						deepHandles.Add("CompaniesByAdministratorsRolesCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< CompaniesByAdministratorsRoles >) DataRepository.CompaniesByAdministratorsRolesProvider.DeepSave,
							new object[] { transactionManager, entity.CompaniesByAdministratorsRolesCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<CompaniesByMasters>
				if (CanDeepSave(entity.CompaniesByMastersCollection, "List<CompaniesByMasters>|CompaniesByMastersCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(CompaniesByMasters child in entity.CompaniesByMastersCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.MasterUsernameSource != null)
						{
								child.MasterUsername = child.MasterUsernameSource.MasterUsername;
						}

					}

					if (entity.CompaniesByMastersCollection.Count > 0 || entity.CompaniesByMastersCollection.DeletedItems.Count > 0)
					{
						//DataRepository.CompaniesByMastersProvider.Save(transactionManager, entity.CompaniesByMastersCollection);
						
						deepHandles.Add("CompaniesByMastersCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< CompaniesByMasters >) DataRepository.CompaniesByMastersProvider.DeepSave,
							new object[] { transactionManager, entity.CompaniesByMastersCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<DriversByCompanies>
				if (CanDeepSave(entity.DriversByCompaniesCollection, "List<DriversByCompanies>|DriversByCompaniesCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(DriversByCompanies child in entity.DriversByCompaniesCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.DriverIdSource != null)
						{
								child.DriverId = child.DriverIdSource.DriverId;
						}

					}

					if (entity.DriversByCompaniesCollection.Count > 0 || entity.DriversByCompaniesCollection.DeletedItems.Count > 0)
					{
						//DataRepository.DriversByCompaniesProvider.Save(transactionManager, entity.DriversByCompaniesCollection);
						
						deepHandles.Add("DriversByCompaniesCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< DriversByCompanies >) DataRepository.DriversByCompaniesProvider.DeepSave,
							new object[] { transactionManager, entity.DriversByCompaniesCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<Log>
				if (CanDeepSave(entity.LogCollection, "List<Log>|LogCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(Log child in entity.LogCollection)
					{
						if(child.CompanyIdSource != null)
						{
							child.CompanyId = child.CompanyIdSource.CompanyId;
						}
						else
						{
							child.CompanyId = entity.CompanyId;
						}

					}

					if (entity.LogCollection.Count > 0 || entity.LogCollection.DeletedItems.Count > 0)
					{
						//DataRepository.LogProvider.Save(transactionManager, entity.LogCollection);
						
						deepHandles.Add("LogCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< Log >) DataRepository.LogProvider.DeepSave,
							new object[] { transactionManager, entity.LogCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<Administrators>
				if (CanDeepSave(entity.AdministratorsCollection, "List<Administrators>|AdministratorsCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(Administrators child in entity.AdministratorsCollection)
					{
						if(child.CompanyIdSource != null)
						{
							child.CompanyId = child.CompanyIdSource.CompanyId;
						}
						else
						{
							child.CompanyId = entity.CompanyId;
						}

					}

					if (entity.AdministratorsCollection.Count > 0 || entity.AdministratorsCollection.DeletedItems.Count > 0)
					{
						//DataRepository.AdministratorsProvider.Save(transactionManager, entity.AdministratorsCollection);
						
						deepHandles.Add("AdministratorsCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< Administrators >) DataRepository.AdministratorsProvider.DeepSave,
							new object[] { transactionManager, entity.AdministratorsCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<Stock>
				if (CanDeepSave(entity.StockCollection, "List<Stock>|StockCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(Stock child in entity.StockCollection)
					{
						if(child.CompanyIdSource != null)
						{
							child.CompanyId = child.CompanyIdSource.CompanyId;
						}
						else
						{
							child.CompanyId = entity.CompanyId;
						}

					}

					if (entity.StockCollection.Count > 0 || entity.StockCollection.DeletedItems.Count > 0)
					{
						//DataRepository.StockProvider.Save(transactionManager, entity.StockCollection);
						
						deepHandles.Add("StockCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< Stock >) DataRepository.StockProvider.DeepSave,
							new object[] { transactionManager, entity.StockCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<ClientsGroupsByCompanies>
				if (CanDeepSave(entity.ClientsGroupsByCompaniesCollection, "List<ClientsGroupsByCompanies>|ClientsGroupsByCompaniesCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(ClientsGroupsByCompanies child in entity.ClientsGroupsByCompaniesCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.ClientGroupIdSource != null)
						{
								child.ClientGroupId = child.ClientGroupIdSource.ClientGroupId;
						}

					}

					if (entity.ClientsGroupsByCompaniesCollection.Count > 0 || entity.ClientsGroupsByCompaniesCollection.DeletedItems.Count > 0)
					{
						//DataRepository.ClientsGroupsByCompaniesProvider.Save(transactionManager, entity.ClientsGroupsByCompaniesCollection);
						
						deepHandles.Add("ClientsGroupsByCompaniesCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< ClientsGroupsByCompanies >) DataRepository.ClientsGroupsByCompaniesProvider.DeepSave,
							new object[] { transactionManager, entity.ClientsGroupsByCompaniesCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<BusRouteByCompanies>
				if (CanDeepSave(entity.BusRouteByCompaniesCollection, "List<BusRouteByCompanies>|BusRouteByCompaniesCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(BusRouteByCompanies child in entity.BusRouteByCompaniesCollection)
					{
						if(child.CompanyIdSource != null)
						{
								child.CompanyId = child.CompanyIdSource.CompanyId;
						}

						if(child.BusRouteIdSource != null)
						{
								child.BusRouteId = child.BusRouteIdSource.BusRouteId;
						}

					}

					if (entity.BusRouteByCompaniesCollection.Count > 0 || entity.BusRouteByCompaniesCollection.DeletedItems.Count > 0)
					{
						//DataRepository.BusRouteByCompaniesProvider.Save(transactionManager, entity.BusRouteByCompaniesCollection);
						
						deepHandles.Add("BusRouteByCompaniesCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< BusRouteByCompanies >) DataRepository.BusRouteByCompaniesProvider.DeepSave,
							new object[] { transactionManager, entity.BusRouteByCompaniesCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<EmailToSendStocks>
				if (CanDeepSave(entity.EmailToSendStocksCollection, "List<EmailToSendStocks>|EmailToSendStocksCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(EmailToSendStocks child in entity.EmailToSendStocksCollection)
					{
						if(child.CompanyIdSource != null)
						{
							child.CompanyId = child.CompanyIdSource.CompanyId;
						}
						else
						{
							child.CompanyId = entity.CompanyId;
						}

					}

					if (entity.EmailToSendStocksCollection.Count > 0 || entity.EmailToSendStocksCollection.DeletedItems.Count > 0)
					{
						//DataRepository.EmailToSendStocksProvider.Save(transactionManager, entity.EmailToSendStocksCollection);
						
						deepHandles.Add("EmailToSendStocksCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< EmailToSendStocks >) DataRepository.EmailToSendStocksProvider.DeepSave,
							new object[] { transactionManager, entity.EmailToSendStocksCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
			//Fire all DeepSave Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			
			// Save Root Entity through Provider, if not already saved in delete mode
			if (entity.IsDeleted)
				this.Save(transactionManager, entity);
				

			deepHandles = null;
						
			return true;
		}
		#endregion
	} // end class
	
	#region CompaniesChildEntityTypes
	
	///<summary>
	/// Enumeration used to expose the different child entity types 
	/// for child properties in <c>GPSTrackingDBV2.Entities.Companies</c>
	///</summary>
	public enum CompaniesChildEntityTypes
	{

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for SettingCollection_From_CompaniesBySetting
		///</summary>
		[ChildEntityType(typeof(TList<Setting>))]
		SettingIdSettingCollection_From_CompaniesBySetting,

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for AdministratorsRolesCollection_From_CompaniesByAdministratorsRoles
		///</summary>
		[ChildEntityType(typeof(TList<AdministratorsRoles>))]
		AdministratorRoleIdAdministratorsRolesCollection_From_CompaniesByAdministratorsRoles,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for CompaniesByDepartmentsCollection
		///</summary>
		[ChildEntityType(typeof(TList<CompaniesByDepartments>))]
		CompaniesByDepartmentsCollection,

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for GeoFencesCollection_From_CompaniesByGeoFences
		///</summary>
		[ChildEntityType(typeof(TList<GeoFences>))]
		GeoFenceIdGeoFencesCollection_From_CompaniesByGeoFences,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for CompaniesByGeoFencesCollection
		///</summary>
		[ChildEntityType(typeof(TList<CompaniesByGeoFences>))]
		CompaniesByGeoFencesCollection,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for UsersCollection
		///</summary>
		[ChildEntityType(typeof(TList<Users>))]
		UsersCollection,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for NotificationsByCompaniesCollection
		///</summary>
		[ChildEntityType(typeof(TList<NotificationsByCompanies>))]
		NotificationsByCompaniesCollection,

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for MastersCollection_From_CompaniesByMasters
		///</summary>
		[ChildEntityType(typeof(TList<Masters>))]
		MasterUsernameMastersCollection_From_CompaniesByMasters,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for CompaniesByMenuCollection
		///</summary>
		[ChildEntityType(typeof(TList<CompaniesByMenu>))]
		CompaniesByMenuCollection,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for ScheduleWorkByCompaniesCollection
		///</summary>
		[ChildEntityType(typeof(TList<ScheduleWorkByCompanies>))]
		ScheduleWorkByCompaniesCollection,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for OrderCollection
		///</summary>
		[ChildEntityType(typeof(TList<Order>))]
		OrderCollection,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for CompaniesByGpsGroupsCollection
		///</summary>
		[ChildEntityType(typeof(TList<CompaniesByGpsGroups>))]
		CompaniesByGpsGroupsCollection,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for CompaniesBySettingCollection
		///</summary>
		[ChildEntityType(typeof(TList<CompaniesBySetting>))]
		CompaniesBySettingCollection,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for CompaniesByAdministratorsRolesCollection
		///</summary>
		[ChildEntityType(typeof(TList<CompaniesByAdministratorsRoles>))]
		CompaniesByAdministratorsRolesCollection,

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for DriversCollection_From_DriversByCompanies
		///</summary>
		[ChildEntityType(typeof(TList<Drivers>))]
		DriverIdDriversCollection_From_DriversByCompanies,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for CompaniesByMastersCollection
		///</summary>
		[ChildEntityType(typeof(TList<CompaniesByMasters>))]
		CompaniesByMastersCollection,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for DriversByCompaniesCollection
		///</summary>
		[ChildEntityType(typeof(TList<DriversByCompanies>))]
		DriversByCompaniesCollection,

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for GpsGroupsCollection_From_CompaniesByGpsGroups
		///</summary>
		[ChildEntityType(typeof(TList<GpsGroups>))]
		GpsGroupIdGpsGroupsCollection_From_CompaniesByGpsGroups,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for LogCollection
		///</summary>
		[ChildEntityType(typeof(TList<Log>))]
		LogCollection,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for AdministratorsCollection
		///</summary>
		[ChildEntityType(typeof(TList<Administrators>))]
		AdministratorsCollection,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for StockCollection
		///</summary>
		[ChildEntityType(typeof(TList<Stock>))]
		StockCollection,

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for DepartmentsCollection_From_CompaniesByDepartments
		///</summary>
		[ChildEntityType(typeof(TList<Departments>))]
		DepartmentIdDepartmentsCollection_From_CompaniesByDepartments,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for ClientsGroupsByCompaniesCollection
		///</summary>
		[ChildEntityType(typeof(TList<ClientsGroupsByCompanies>))]
		ClientsGroupsByCompaniesCollection,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for BusRouteByCompaniesCollection
		///</summary>
		[ChildEntityType(typeof(TList<BusRouteByCompanies>))]
		BusRouteByCompaniesCollection,

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for ScheduleWorkCollection_From_ScheduleWorkByCompanies
		///</summary>
		[ChildEntityType(typeof(TList<ScheduleWork>))]
		ScheduleWorkIdScheduleWorkCollection_From_ScheduleWorkByCompanies,

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for MenuCollection_From_CompaniesByMenu
		///</summary>
		[ChildEntityType(typeof(TList<Menu>))]
		MenuIdMenuCollection_From_CompaniesByMenu,

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for BusRoutesCollection_From_BusRouteByCompanies
		///</summary>
		[ChildEntityType(typeof(TList<BusRoutes>))]
		BusRouteIdBusRoutesCollection_From_BusRouteByCompanies,

		///<summary>
		/// Collection of <c>Companies</c> as OneToMany for EmailToSendStocksCollection
		///</summary>
		[ChildEntityType(typeof(TList<EmailToSendStocks>))]
		EmailToSendStocksCollection,

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for NotificationsCollection_From_NotificationsByCompanies
		///</summary>
		[ChildEntityType(typeof(TList<Notifications>))]
		NotificationIdNotificationsCollection_From_NotificationsByCompanies,

		///<summary>
		/// Collection of <c>Companies</c> as ManyToMany for ClientsGroupsCollection_From_ClientsGroupsByCompanies
		///</summary>
		[ChildEntityType(typeof(TList<ClientsGroups>))]
		ClientGroupIdClientsGroupsCollection_From_ClientsGroupsByCompanies,
	}
	
	#endregion CompaniesChildEntityTypes
	
	#region CompaniesFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;CompaniesColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Companies"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class CompaniesFilterBuilder : SqlFilterBuilder<CompaniesColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the CompaniesFilterBuilder class.
		/// </summary>
		public CompaniesFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the CompaniesFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public CompaniesFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the CompaniesFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public CompaniesFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion CompaniesFilterBuilder
	
	#region CompaniesParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;CompaniesColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Companies"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class CompaniesParameterBuilder : ParameterizedSqlFilterBuilder<CompaniesColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the CompaniesParameterBuilder class.
		/// </summary>
		public CompaniesParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the CompaniesParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public CompaniesParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the CompaniesParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public CompaniesParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion CompaniesParameterBuilder
	
	#region CompaniesSortBuilder
    
    /// <summary>
    /// A strongly-typed instance of the <see cref="SqlSortBuilder&lt;CompaniesColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Companies"/> object.
    /// </summary>
    [CLSCompliant(true)]
    public class CompaniesSortBuilder : SqlSortBuilder<CompaniesColumn>
    {
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the CompaniesSqlSortBuilder class.
		/// </summary>
		public CompaniesSortBuilder() : base() { }

		#endregion Constructors

    }    
    #endregion CompaniesSortBuilder
	
} // end namespace
